package com.bitcola.security.dataservice.controller;

import com.bitcola.security.dataservice.mapper.MarketUserMapper;
import com.bitcola.market.MarketUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("marketUser")
public class MarketUserController {
    @Autowired
    MarketUserMapper marketUserMapper;
    @RequestMapping("all")

    public Map<String, MarketUser>getAll()
    {
     var list=marketUserMapper.selectAll();

     var map=new HashMap<String,MarketUser>();
     list.forEach(x->{
         map.put(x.getCoinCode(),x);
     });

     return map;
    }

}
